/**
 * @company : 版权所属 四川北星惯牌科技有限公司
 * @contact : 刘经理 19326416371
 **/
/*
 *mainBackground 背景图
 *mpCode  小程序码
 */
import {
	userInfoStore
} from "@/stores/user";

export const shareExtendFun = ({
	mainBackground,
	mpCode
}) => {
	const {
		userInfo
	} = userInfoStore();
	return {
		css: {
			width: '680rpx',
			margin: '0 auto',
			height: '820rpx',
			borderRadius: '12rpx',
			display: 'flex',
			flexDirection: 'column',
			boxSizing: 'border-box',
			justifyContent: 'space-between',
			position: 'relative',
			overflow: 'hidden',
			boxShadow: '0rpx 0 20rpx 2rpx rgba(190, 230, 252, 0.3)'
		},
		views: [{ //头部
				type: 'view',
				css: {
					display: 'flex',
					width: '100%',
					boxSizing: 'border-box',
					padding: '24rpx',
					height: '176rpx',
					background: 'linear-gradient(180deg, #0E0F0F  0%, transparent  100%)',
				},
				views: [{
					type: 'image',
					src: userInfo.avatar,
					css: {
						width: '128rpx',
						height: '128rpx',
						objectFit: 'cover',
						borderRadius: '16rpx',
					}
				}, {
					type: 'view',
					css: {
						display: 'flex',
						flexDirection: 'column',
						height: '100%',
						flex: 1,
						marginLeft: '18rpx',
						justifyContent: 'space-evenly',
					},
					views: [{
							type: 'text',
							css: {
								fontWeight: 'bold',
								fontSize: '38rpx',
								color: '#C8C9C9',
							},
							text: userInfo.nickname || '无敌战神',
						},
						{
							type: 'text',
							css: {
								fontWeight: 'bold',
								fontSize: '26rpx',
								color: '#C8C9C9',
							},
							text: `推广码：${userInfo.invite_code}`,
						}
					]
				}]
			}, { //主题图
				type: 'image',
				src: mainBackground,
				objectFit: 'contain',
				css: {
					width: '100%',
					height: '820rpx',
					objectFit: 'cover',
					position: 'absolute',
					top: 0,
					left: 0,
					zIndex: -1
				}
			},
			{
				type: 'image',
				css: {
					width: '184rpx',
					height: '184rpx',
					borderRadius: '12rpx',
					position: 'absolute',
					bottom: '40rpx',
					right: '40rpx',
					zIndex: 1
				},
				src: mpCode,
			}

		]
	}
}